package com.example.product.config;

import org.apache.seata.spring.boot.autoconfigure.SeataAutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
@Configuration

@EnableAutoConfiguration(exclude = SeataAutoConfiguration.class) // 新增排除 Seata 自动配置
public class ProductConfig {

    @LoadBalanced
        @Bean
            //RestTemplate组件，用于发送远程调用（即http请求）
        RestTemplate restTemplate(){
            return new RestTemplate();
        }


}
